#include<iostream>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

char Verse(int a,int n)
{
	if (a % n < 10)return a % n + '0';
	return a % n + 'A' - 10;
}

string Getret(long long x,int n)
{
	string ret = "";
	for (int i = 0; x > 0; i++)
	{
		ret += Verse(x, n);
		x /= n;
	}
	reverse(ret.begin(), ret.end());
	return ret;
}


int main()
{
	int n = 0;
	cin >> n;
	for (int i = 1; i <= n - 1; i++)
	{
		for (int j = 1; j <= n - 1; j++)
		{
			if (i >= j)
			{
				cout << Getret(i, n) << "*" << Getret(j, n) << "=" << Getret(i * j, n) << " ";
			}
		}
		cout << endl;
	}

	return 0;
}